package com.aaa.service.fpa.impl;

import com.aaa.dao.fpa.ViewTestResultFpaDao;
import com.aaa.entity.PageSortEntity;
import com.aaa.entity.fpa.ViewTestResultFpa;
import com.aaa.service.fpa.ViewTestResultFpaService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @author ：chenang（731712841@qq.com）
 * @date ：Created in 2022/9/5 14:26
 * @description：  视图 view_test_result_fpa
 * @modified By：
 * @version:
 */
@Service
public class ViewTestResultFpaServiceImpl implements ViewTestResultFpaService {
    @Autowired
    ViewTestResultFpaDao viewTestResultFpaDao;
    /**
     * 分页查询
     * @param viewTestResultFpa 筛选条件
     * @param pageSortEntity      分页对象
     * @return
     */
    @Override
    public Page<ViewTestResultFpa> queryByPage(ViewTestResultFpa viewTestResultFpa, PageSortEntity pageSortEntity) {
        PageHelper.startPage(pageSortEntity.getPage(), pageSortEntity.getLimit(), pageSortEntity.getOrderString());
        List<ViewTestResultFpa> viewTestResultFpas = viewTestResultFpaDao.ViewTestResultFpaAll(viewTestResultFpa);
        Page page = (Page) viewTestResultFpas;
        return page;
    }
    /**
     * 多行删除 , 单行删除
     */
    @Override
    public int delViewTestResultFpa(int[] id) {
        ArrayList<Object> objects = new ArrayList<>();
        for(int i : id){
            objects.add(i);
        }
        int i = viewTestResultFpaDao.delViewTestResultFpa(objects);
        return i;
    }
}
